<?php
/**
 * WHQ entry point
 *
 * This sets constant values and calls >> router >> controller
 * 
 * @author Milan Rukavina <rukavinamilan@gmail.com>
 * @version 0.1
 * @package whq
 */

//error_reporting(E_ALL);

/**
 * Application root directory real path
 */ 
define('ROOT_PATH', realpath(dirname(__FILE__)) . DIRECTORY_SEPARATOR);

/**
 * Library directory real path
 */ 
define('LIB_PATH', ROOT_PATH . "library" . DIRECTORY_SEPARATOR);

//load config
include_once(ROOT_PATH . "config.php");

//load and activate autoloader
include_once(LIB_PATH . "WHQ/Loader.php");
WHQ_Loader::activate(LIB_PATH);

//get db model

WHQ_Model_Db::getInstance($config['model']);

//get router and dispatch
WHQ_Router::getInstance()->dispatch();